<html>
<head><meta charset="utf-8"><title>nested impl trait warning period PR #58608 · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nested.20impl.20trait.20warning.20period.20PR.20.2358608.html">nested impl trait warning period PR #58608</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="160470826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nested%20impl%20trait%20warning%20period%20PR%20%2358608/near/160470826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nested.20impl.20trait.20warning.20period.20PR.20.2358608.html#160470826">(Mar 11 2019 at 11:34)</a>:</h4>
<p>hey <span class="user-mention" data-user-id="116466">@Zoxc</span> can you clarify why you don't think we can get away with just setting the <code>warning_period_57979_nested_impl_trait</code> back to <code>false</code> at the "right" point(s) in the control flow?</p>



<a name="160470864"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nested%20impl%20trait%20warning%20period%20PR%20%2358608/near/160470864" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nested.20impl.20trait.20warning.20period.20PR.20.2358608.html#160470864">(Mar 11 2019 at 11:35)</a>:</h4>
<p>Its not that I'm trying to argue that you are wrong; if anything, the failure of my prior attempt to do this makes me think that you are <em>right</em></p>



<a name="160470881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nested%20impl%20trait%20warning%20period%20PR%20%2358608/near/160470881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nested.20impl.20trait.20warning.20period.20PR.20.2358608.html#160470881">(Mar 11 2019 at 11:35)</a>:</h4>
<p>but I nonetheless haven't grokked why the old NestedImplTraitVisitor is necessary to exhibit the behavior</p>



<a name="160470968"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nested%20impl%20trait%20warning%20period%20PR%20%2358608/near/160470968" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nested.20impl.20trait.20warning.20period.20PR.20.2358608.html#160470968">(Mar 11 2019 at 11:37)</a>:</h4>
<p>It seems hard to reason about and it's possible fragile since the AST validator is likely to be changed. I'm not saying it's impossible, but it's probably not worthwhile.</p>



<a name="160471057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nested%20impl%20trait%20warning%20period%20PR%20%2358608/near/160471057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nested.20impl.20trait.20warning.20period.20PR.20.2358608.html#160471057">(Mar 11 2019 at 11:39)</a>:</h4>
<p>yeah, the "worthwhile use of programming effort" point is definitely the one I'm struggling with</p>



<a name="160471073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nested%20impl%20trait%20warning%20period%20PR%20%2358608/near/160471073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nested.20impl.20trait.20warning.20period.20PR.20.2358608.html#160471073">(Mar 11 2019 at 11:39)</a>:</h4>
<p>Given that we're going to remove this code later, I'd go with the easy option</p>



<a name="160475080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nested%20impl%20trait%20warning%20period%20PR%20%2358608/near/160475080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nested.20impl.20trait.20warning.20period.20PR.20.2358608.html#160475080">(Mar 11 2019 at 12:44)</a>:</h4>
<p>Ah! now I see where the original logic truly went wrong. I had thought the issue was that skipping <code>visit_ty</code> meant that it missed the <em>check</em> for an outer impl trait; but that wasn't the problem at all. It was that calling <code>walk_ty</code> instead of <code>visit_ty</code> meant that we missed a <em>single</em> overwrite of an outer impl trait.</p>



<a name="160475119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nested%20impl%20trait%20warning%20period%20PR%20%2358608/near/160475119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nested.20impl.20trait.20warning.20period.20PR.20.2358608.html#160475119">(Mar 11 2019 at 12:44)</a>:</h4>
<p>this misunderstanding of my own explains why I had such difficulty making test cases that would illustrate the fine distinctions here.</p>



<a name="160488759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nested%20impl%20trait%20warning%20period%20PR%20%2358608/near/160488759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nested.20impl.20trait.20warning.20period.20PR.20.2358608.html#160488759">(Mar 11 2019 at 15:32)</a>:</h4>
<p>okay I've updated the PR now. I think this captures the previous behavior very precisely.</p>



<a name="160563406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nested%20impl%20trait%20warning%20period%20PR%20%2358608/near/160563406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nested.20impl.20trait.20warning.20period.20PR.20.2358608.html#160563406">(Mar 12 2019 at 11:53)</a>:</h4>
<p>hey, <span class="user-mention" data-user-id="116466">@Zoxc</span> , you said your feedback about the incorrect comment was not addressed, but I thought I did address it</p>



<a name="160563409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nested%20impl%20trait%20warning%20period%20PR%20%2358608/near/160563409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nested.20impl.20trait.20warning.20period.20PR.20.2358608.html#160563409">(Mar 12 2019 at 11:53)</a>:</h4>
<p>are you talking about <a href="https://github.com/rust-lang/rust/pull/58608#discussion_r259098166" target="_blank" title="https://github.com/rust-lang/rust/pull/58608#discussion_r259098166">this feedback</a> ?</p>



<a name="160563474"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nested%20impl%20trait%20warning%20period%20PR%20%2358608/near/160563474" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nested.20impl.20trait.20warning.20period.20PR.20.2358608.html#160563474">(Mar 12 2019 at 11:54)</a>:</h4>
<p>Oh maybe I misunderstood your comment</p>



<a name="160563494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nested%20impl%20trait%20warning%20period%20PR%20%2358608/near/160563494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nested.20impl.20trait.20warning.20period.20PR.20.2358608.html#160563494">(Mar 12 2019 at 11:55)</a>:</h4>
<p>I thought you were objecting to the use of the word "incomplete" (and were suggesting I say "bugged" instead, and I settled on "buggy")</p>



<a name="160563513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nested%20impl%20trait%20warning%20period%20PR%20%2358608/near/160563513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nested.20impl.20trait.20warning.20period.20PR.20.2358608.html#160563513">(Mar 12 2019 at 11:55)</a>:</h4>
<p>but re-reading interaction now, I realize that you may have been objecting to my phrasing "until sometime after PR <a href="https://github.com/rust-lang/rust/issues/57730" target="_blank" title="https://github.com/rust-lang/rust/issues/57730">#57730</a> landed", and that you'd prefer "until PR <a href="https://github.com/rust-lang/rust/issues/57730" target="_blank" title="https://github.com/rust-lang/rust/issues/57730">#57730</a> landed"</p>



<a name="160563561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nested%20impl%20trait%20warning%20period%20PR%20%2358608/near/160563561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nested.20impl.20trait.20warning.20period.20PR.20.2358608.html#160563561">(Mar 12 2019 at 11:56)</a>:</h4>
<p>Yeah</p>



<a name="160563563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nested%20impl%20trait%20warning%20period%20PR%20%2358608/near/160563563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nested.20impl.20trait.20warning.20period.20PR.20.2358608.html#160563563">(Mar 12 2019 at 11:56)</a>:</h4>
<p>the reason I chose the phrasing "sometime after <a href="https://github.com/rust-lang/rust/issues/57730" target="_blank" title="https://github.com/rust-lang/rust/issues/57730">#57730</a>" is because the analysis even with <a href="https://github.com/rust-lang/rust/issues/57730" target="_blank" title="https://github.com/rust-lang/rust/issues/57730">#57730</a> was still buggy.</p>



<a name="160563599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nested%20impl%20trait%20warning%20period%20PR%20%2358608/near/160563599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nested.20impl.20trait.20warning.20period.20PR.20.2358608.html#160563599">(Mar 12 2019 at 11:57)</a>:</h4>
<p>I could say "until PRs <a href="https://github.com/rust-lang/rust/issues/57730" target="_blank" title="https://github.com/rust-lang/rust/issues/57730">#57730</a> and <a href="https://github.com/rust-lang/rust/issues/57981" target="_blank" title="https://github.com/rust-lang/rust/issues/57981">#57981</a> landed"</p>



<a name="160563612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nested%20impl%20trait%20warning%20period%20PR%20%2358608/near/160563612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nested.20impl.20trait.20warning.20period.20PR.20.2358608.html#160563612">(Mar 12 2019 at 11:57)</a>:</h4>
<p>would that be satisfactory?</p>



<a name="160563644"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nested%20impl%20trait%20warning%20period%20PR%20%2358608/near/160563644" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nested.20impl.20trait.20warning.20period.20PR.20.2358608.html#160563644">(Mar 12 2019 at 11:57)</a>:</h4>
<p>Sure</p>



<a name="160563656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/nested%20impl%20trait%20warning%20period%20PR%20%2358608/near/160563656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/nested.20impl.20trait.20warning.20period.20PR.20.2358608.html#160563656">(Mar 12 2019 at 11:57)</a>:</h4>
<p>okay great. I'll make that change and then <code>@bors r=zoxc</code>. Thanks!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>